package com.leyou.item.mapper;

import com.leyou.item.pojo.Category;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;

public interface CategoryMapper extends Mapper<Category> {

    // 根据品牌id查询品牌分类
    @Select("select tc.id, tc.name, tc.parent_id, tc.is_parent from tb_category_brand tcb left join tb_category tc on tcb.category_id = tc.id where tcb.brand_id = #{id}")
    List<Category> queryByBrandId(@Param("id") Long brandId);
}
